--
-- DESCRIPTION
--
-- @COMPANY **
-- @AUTHOR **
-- @DATE ${date} ${time}
--


---@type BP_Samurai_NPC_C
local M = UnLua.Class("Draw.Blueprints.BP_Samurai")

--- require("UnLuaDebug")

local KismetSystemLibrary = UE.UKismetSystemLibrary
local Math = UE.UKismetMathLibrary

-- function M:Initialize(Initializer)
-- end

-- function M:UserConstructionScript()
-- end

function M:ReceiveBeginPlay()
    self.Super.ReceiveBeginPlay(self)
    self.GameMode.DrawPhaseStarted:Add(self, self.DrawPhaseStarted)

end

-- function M:ReceiveEndPlay()
-- end

-- function M:ReceiveTick(DeltaSeconds)
-- end

-- function M:ReceiveAnyDamage(Damage, DamageType, InstigatedBy, DamageCauser)
-- end

-- function M:ReceiveActorBeginOverlap(OtherActor)
-- end

-- function M:ReceiveActorEndOverlap(OtherActor)
-- end

--- 开始随机时间攻击
--[[local function StartDraw(self)

    KismetSystemLibrary.Delay(self, Math.RandomFloatInRange(0.15, 0.35))

    self:Attack()
end]]

--- 回调函数
function M:DrawPhaseStarted()
    -- coroutine.resume(coroutine.create(StartDraw), self)  在协程中调用 Latent 函数
    KismetSystemLibrary.K2_SetTimerDelegate({ self, self.Attack }, Math.RandomFloatInRange(0.15, 0.35), false)
end

return M
